<template>
    <div class="home">
        <img alt="Vue logo" src="../assets/logo.png">
        <div style="min-height:3px; background:#eee" @click="clickTitle">
            <span>{{ test_title }}</span>
        </div>
        <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
    </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";

import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src
import { COMMIT_TITLE } from "@/store_module/base";

@Component({
    components: {
        HelloWorld
    }
})
export default class Home extends Vue {
    get test_title(): string {
        return this.$storeTS.getters.new_title;
    }

    clickTitle() {
        this.$storeTS.commit(
            COMMIT_TITLE,
            "测试 " + new Date().toISOString()
        );
    }
}
</script>
